/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package negocio;

import java.io.Serializable;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Dvid
 */
@Entity
@Table(name = "deptosucur")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Deptosucur.findAll", query = "SELECT d FROM Deptosucur d"),
    @NamedQuery(name = "Deptosucur.findByDeptoid", query = "SELECT d FROM Deptosucur d WHERE d.deptosucurPK.deptoid = :deptoid"),
    @NamedQuery(name = "Deptosucur.findBySucurid", query = "SELECT d FROM Deptosucur d WHERE d.deptosucurPK.sucurid = :sucurid")})
public class Deptosucur implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected DeptosucurPK deptosucurPK;

    public Deptosucur() {
    }

    public Deptosucur(DeptosucurPK deptosucurPK) {
        this.deptosucurPK = deptosucurPK;
    }

    public Deptosucur(int deptoid, int sucurid) {
        this.deptosucurPK = new DeptosucurPK(deptoid, sucurid);
    }

    public DeptosucurPK getDeptosucurPK() {
        return deptosucurPK;
    }

    public void setDeptosucurPK(DeptosucurPK deptosucurPK) {
        this.deptosucurPK = deptosucurPK;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (deptosucurPK != null ? deptosucurPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Deptosucur)) {
            return false;
        }
        Deptosucur other = (Deptosucur) object;
        if ((this.deptosucurPK == null && other.deptosucurPK != null) || (this.deptosucurPK != null && !this.deptosucurPK.equals(other.deptosucurPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "negocio.Deptosucur[ deptosucurPK=" + deptosucurPK + " ]";
    }
    
}
